import { Component, OnInit } from '@angular/core';
import { NzModalRef, NzMessageService } from 'ng-zorro-antd';
import { _HttpClient } from '@delon/theme';
import { CommonService } from '@core/service/common.service';

@Component({
  selector: 'app-sys-dic-dic-modal',
  templateUrl: './dic-modal.component.html',
})
export class SysDicDicModalComponent implements OnInit {
  url = '';
  i: any;

  constructor(
    private modal: NzModalRef,
    public msgSrv: NzMessageService,
    public http: _HttpClient,
    public commonService: CommonService
  ) { }

  ngOnInit(): void {
    this.url =  `${this.commonService.getServerPath()}api/sysDic`;
    this.i = Object.assign({}, this.i);
  }

  save() {
    this.http.post(this.url,this.i).subscribe((succ) => {
      this.modal.close(true);
      this.close();
    });
  }

  close() {
    this.modal.destroy();
  }
}
